<template>
  <div class="hello">
    <button v-on:click="counter +=1">点击:counter={{counter}}</button>
    <button @click="counter +=1">点击:counter={{counter}}</button>
    <button @click="clickHandle">按钮</button>
    <p>{{msg}}</p>

    <button @click="say('hi')">say hi</button>
    <button @click="say('what')">say what</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data() {
    return {
      counter: 0,
      msg:'Hello World'
    }
  },
  methods:{
    clickHandle() {
      this.msg = '按钮被点击了'
    },
    say(word) {
      console.log(word);
    },
  }
}
</script>
